package com.pang.springcloud.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author： pang-yun
 * @date： 2022-02-12 11:53
 * Description:
 */

@Component
@FeignClient(value = "CLOUD-PAYMENT-HYSTRIX-SERVICE", fallback = HystrixServiceMethod.class)  // 远程调用的微服务
public interface PaymentHystrixService {
    //---------------------hystrix----服务降级
    @GetMapping("/payment/hystrix/ok/{id}")
    String paymentInfo_OK(@PathVariable("id") Long id);

    @GetMapping("/payment/hystrix/timeout/{id}")
    String paymentInfo_TIMEOUT(@PathVariable("id") Long id);
}
